<?php

/**
 * History form base class.
 *
 * @package    form
 * @subpackage history
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseHistoryForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'task_id'             => new sfWidgetFormDoctrineSelect(array('model' => 'Task', 'add_empty' => false)),
      'priority_changed_to' => new sfWidgetFormInput(),
      'status_changed_to'   => new sfWidgetFormInput(),
      'deadline_changed_to' => new sfWidgetFormDateTime(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorDoctrineChoice(array('model' => 'History', 'column' => 'id', 'required' => false)),
      'task_id'             => new sfValidatorDoctrineChoice(array('model' => 'Task')),
      'priority_changed_to' => new sfValidatorInteger(array('required' => false)),
      'status_changed_to'   => new sfValidatorInteger(array('required' => false)),
      'deadline_changed_to' => new sfValidatorDateTime(array('required' => false)),
      'created_at'          => new sfValidatorDateTime(array('required' => false)),
      'updated_at'          => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('history[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'History';
  }

}